package com.yztc.thinkpad.mandemo.single;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;


/**
 * Created by meidou on 2016/10/6.
 */
public class FragmentAdapter extends FragmentPagerAdapter {
    List<SingleViewpagerFragment> mList;
    public FragmentAdapter(FragmentManager fm, List<SingleViewpagerFragment> mList) {
        super(fm);
        this.mList=mList;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mList.get(position).getDataBean().getName();
    }
}
